#ifndef CLIENTHANDELR_H
#define CLIENTHANDELR_H

#include <QObject>
#include <QTcpSocket>
#include<QMessageBox>
#include<QDebug>
#include<QFile>
#include<QDir>
#include "messagepackage.h"

class clientHandelr : public QObject
{
    Q_OBJECT
public:
    explicit clientHandelr(QTcpSocket* socket,QObject *parent = nullptr);

    void setServerManager(QObject* server);
    //会议相关
    void createMeetingHandler(MessagePackage &pack);
    void joinMeetingHandler(MessagePackage &pack);

   int  meetingnum=0;

private:

    QTcpSocket* socket= nullptr;

    QObject* server;

    void registHanler(MessagePackage& pack);
    void loginHanler(MessagePackage& pack);
    void quitHanler(MessagePackage& pack);
    void listUPHanler(MessagePackage& pack);

    //群组相关
    void groupCreateHandler(MessagePackage &pack);
    void groupMessageHandler(MessagePackage &pack);
    void groupListHandler(MessagePackage &pack);
    void groupJoinHandler(MessagePackage &pack);

private slots:
    void onReadyRead();
signals:
    void update_onl();
    void new_onlUser(QString name,QTcpSocket* socket);//在线列表错误获取
    void onl_userOff(QString name);
    void client_upList(QTcpSocket* socket);
    void singleMessage(MessagePackage& pack);
    void setFile(QString file);
    void clcFile();
    void setVideoList(QString video);
};

#endif // CLIENTHANDELR_H
